/**
 * 模仿 Math.max
 * @param {number} 传任意个数字
 * @returns {number}
 */

function maxNum() {
  const arr = Array.prototype.slice.call(arguments)
  let max = 0
  arr.forEach(itemNum => {
    if (+itemNum > max) {
      max = +itemNum
    }
  })
  return max
}

console.log(maxNum(2, 4, 1, 7, 2, 9))
